package com.shuzi.MediaShare.gui.history;

import android.content.Context;
import com.shuzi.MediaShare.Constant;
import com.shuzi.MediaShare.control.CacheDataManager;
import com.shuzi.MediaShare.model.MovieInfo;

/**
 * @author lung 下午5:30:48 2013
 */
public class HistorUtil
{

	/**
	 * 添加到历史记录
	 * 
	 * @param context
	 * @param movieInfo
	 * @return
	 */
	public static boolean addToHistory(Context context, MovieInfo movieInfo)
	{
		if (Constant.historymMap.containsKey(movieInfo.getID()))
		{
			return false;
		}
		Constant.historyList.add(0, movieInfo);
		Constant.historymMap.put(movieInfo.getID(), movieInfo);
		return CacheDataManager.getInstance().saveCachDataToFile(context,
				"HISTORY", Constant.historyList);

	}

}
